#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using i128 = __int128;
const int N = 1e3 + 5;

int fa[N];
int pos[N][2];

struct edge {
    int u, v;
    double w;
};

vector<edge> a;

int find(int x) {
    if (fa[x] == x) return x;
    return fa[x] = find(fa[x]);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n, k;
    scanf("%d %d", &n, &k);
    for (int i = 1; i <= n; i++) {
        scanf("%d %d", &pos[i][0], &pos[i][1]);
    }
    for (int i = 1; i <= n; i++) {
        for (int j = i + 1; j <= n; j++) {
            int dx = pos[i][0] - pos[j][0];
            int dy = pos[i][1] - pos[j][1];
            double dis = dx * dx + dy * dy;
            a.push_back({i, j, dis});
        }
    }
    sort(a.begin(), a.end(),
         [](const edge& a, const edge& b) { return a.w < b.w; });
    for (int i = 1; i <= n; i++) {
        fa[i] = i;
    }
    int cnt = 0;
    int p = 0;
    for (; p < a.size(); p++) {
        int u = a[p].u;
        int v = a[p].v;
        int fu = find(u), fv = find(v);
        if (fu != fv) {
            fa[fu] = fv;
            cnt++;
            if (cnt == n - k) break;
        }
    }
    p++;
    for (; p < a.size(); p++) {
        int u = a[p].u;
        int v = a[p].v;
        int fu = find(u), fv = find(v);
        if (fu != fv) {
            printf("%.2f\n", sqrt(a[p].w));
            return 0;
        }
    }

    return 0;
}